﻿#region

using System;
using System.Web.UI;
using BusinessLogicLayer;

#endregion

namespace FastTrackCabService
{
    public partial class ResetPassword : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Guid guid;
            if (!Guid.TryParse(Request.QueryString["guid"], out guid) || !UserBLL.IsResetLinkValid(guid))
            {
                Server.Transfer("InvalidLink.aspx");
            }
        }

        protected void btnReset_OnClick(object sender, EventArgs e)
        {
            var guid = Guid.Parse(Request.QueryString["guid"]);
            UserBLL.UpdatePassword(guid, txtPassword.Text);
            Response.Redirect("PasswordResetSuccessMessage.aspx");
        }
    }
}